package com.lihepeng.leecode.frequency.ArrayList;

import org.junit.Test;

/**
 * 判断是不是回文字符串
 * abcba 是回文
 */
public class Solution88 {
    public boolean judge (String str) {
        int i=0;
        int j = str.length()-1;
        while (i< j) {
            if (str.charAt(i++) != str.charAt(j--)) {
                return false;
            }
        }
        return true;
    }
    @Test
    public void runTest() {
        System.out.println(judge("abcba"));
    }
}
